{{ define "main" }}
{{ partial "profile.html" . }}

<div id="list-page">
    {{ $pages := .Site.RegularPages }}
    {{ $paginator := .Paginate ($pages) }}
    {{ range $paginator.Pages }}
        {{ $title := .Title }}
        {{ $summary := .Summary }}
        <section class="item">
          <div>
            <h1 class="title"><a href='{{ .RelPermalink }}'>{{ $title }}</a></h1>
            <div class ="date">
                <time datetime="{{ .PublishDate }}">{{ i18n "publishDate" . }}</time>  
            </div>
          </div>

          {{ if ne .Site.Params.hiddenPostSummaryInHomePage true }}
              <div class="summary">{{ $summary | plainify | htmlUnescape }}</div>
          {{ end }}

        </section>
    {{ end }}

    {{ if or ($paginator.HasPrev) ($paginator.HasNext) }}
        <div class="pagination">
          {{ if $paginator.HasPrev }}
              <span class="prev">
                  <a href="{{.Paginator.Prev.URL}}">
                      <span class="arrow">←</span> {{ with .Site.Params.newerPosts }}{{ . }}{{ else }}{{ i18n "postsNewer" }}{{ end }}
                  </a>
            </span>
          {{ end }}
          
          {{ if $paginator.HasNext }}
              <span class="next">
                  <a href="{{.Paginator.Next.URL}}">
                      {{ with .Site.Params.olderPosts }}{{ . }}{{ else }}{{ i18n "postsOlder" }}{{ end }} <span class="arrow">→</span>
                  </a>
              </span>
          {{ end }}
        </div>
    {{ end }}


</div>
{{ end }}
